import axios from '~/axios'

/**
 * 添加价格配置
 * @param {Object} data 价格配置数据
 * @returns {Promise}
 */
export function addPriceConfigApi(data) {
  return axios({
    url: '/basic/lindi/priceConfig/addPriceConfig',
    method: 'post',
    data
  })
}

/**
 * 删除价格配置
 * @param {number} priceConfigId 价格配置ID
 * @returns {Promise}
 */
export function deletePriceConfigByPriceConfigIdApi(priceConfigId) {
  return axios({
    url: '/basic/lindi/priceConfig/deletePriceConfigByPriceConfigId',
    method: 'delete',
    params: {
      priceConfigId
    }
  })
}

/**
 * 更新价格配置
 * @param {Object} data 价格配置数据
 * @returns {Promise}
 */
export function updatePriceConfigByPriceConfigIdApi(data) {
  return axios({
    url: '/basic/lindi/priceConfig/updatePriceConfigByPriceConfigId',
    method: 'put',
    data
  })
}

/**
 * 分页查询价格配置列表
 * @param {Object} data 查询条件
 * @returns {Promise}
 */
export function getPagePriceConfigListApi(data) {
  return axios({
    url: '/basic/lindi/priceConfig/getPagePriceConfigList',
    method: 'get',
    data
  })
}

/**
 * 根据ID查询价格配置详情
 * @param {number} priceConfigId 价格配置ID
 * @returns {Promise}
 */
export function getPriceConfigByPriceConfigIdApi(priceConfigId) {
  return axios({
    url: `/basic/lindi/priceConfig/getPriceConfigByPriceConfigId/${priceConfigId}`,
    method: 'get'
  })
}